from selenium.webdriver.common.by import By

from Common.Unity import ForumDriver


class TestRegister:
    driver:""
    url:""
    def __init__(self):
        self.url = "http://127.0.0.1:9580/sign-up.html"
        self.driver = ForumDriver.driver
        self.driver.get(self.url)

    def RegisterSucTest1(self):
        self.driver.find_element(By.CSS_SELECTOR,"#username").send_keys("yyy")
        self.driver.find_element(By.CSS_SELECTOR, "#nickname").send_keys("yyy")
        self.driver.find_element(By.CSS_SELECTOR, "#password").send_keys("123456")
        self.driver.find_element(By.CSS_SELECTOR, "#passwordRepeat").send_keys("123456")
        self.driver.find_element(By.CSS_SELECTOR, "#policy").click()
        self.driver.find_element(By.CSS_SELECTOR, "#submit").click()
        print("测试注册的功能成功")

    # def RegisterFileTest1(self):


# Register = TestRegister()
# Register.RegisterFileTest1()
# Register.driver.quit()